#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int arr[105];
	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			sum += arr[i] * arr[j];
		}
	}
	cout << sum << endl;
	return 0;
}